ubuntu18.04搭建rtmp server 您所在的位置:网站首页 nodejs rtmp ubuntu18.04搭建rtmp server

ubuntu18.04搭建rtmp server

#ubuntu18.04搭建rtmp server| 来源: 网络整理| 查看: 265

在Ubuntu 18.04上搭建RTMP服务器可以通过以下步骤完成:

安装Nginx

sudo apt update

sudo apt install nginx

安装RTMP模块

sudo apt install libnginx-mod-rtmp

配置Nginx

编辑Nginx配置文件

sudo nano /etc/nginx/nginx.conf

在http部分添加RTMP配置

rtmp {

server {

listen 1935; #RTMP默认端口

chunk_size 4096;

application live {

live on;

recordoff;

}

}

}

重新启动Nginx

sudo systemctl restart nginx

使用FFmpeg推流

ffmpeg -re -i D:\Users\test.mkv -vcodec copy -codec copy -f flv -flvflags no_duration_filesize rtmp://192.168.47.128/live/test,默认的推流地址是:rtmp:///live/,其中可以自己定义。

有可能会报以下错误:

Failed to update header with correct duration. Failed to update header with correct filesize.

stackoverflow上面有答案:

使用VLC播放器播放

可以使用VLC等支持RTMP协议的播放器进行播放,默认的播放地址是:rtmp:///live/,其中需要和推流时定义的一致。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有